import turtle as t
import time
def drawGap():
    t.penup()
    t.fd(5)
def drawLine(flag):
    drawGap()
    t.pendown() if flag else t.penup()
    t.fd(20)
    drawGap()
    t.right(90)


def drawDigit(digit):
    drawLine(True) if digit in [2,3,4,5,6,8,9] else drawLine(False)
    drawLine(True) if digit in [0,1,3,4,5,6,7,8,9] else drawLine(False)
    drawLine(True) if digit in [0,2,3,5,6,8,9] else drawLine(False)
    drawLine(True) if digit in [0,2,6,8] else drawLine(False)
    t.left(90)
    drawLine(True) if digit in [0,4,5,6,8,9] else drawLine(False)
    drawLine(True) if digit in [0,2,3,5,6,7,8,9] else drawLine(False)
    drawLine(True) if digit in [0,1,2,3,4,7,8,9] else drawLine(False)
    drawLine(False)
    t.right(90)

def drawDigits(digits):
    """
    @param digits: 数字列表
    @return: None
    """
    for i in digits:
        t.penup()
        t.fd(40)
        drawDigit(i)

def drawDate(date):
    for i in date:
        if i != '年' and i != '月' and i != '日':
            t.pencolor('red')
            drawDigit(int(i))
        else:
            t.pencolor('black')
            t.penup()
            t.right(90)
            t.fd(35)
            t.left(90)
            t.write(i,font=('宋体',50,'normal'))
            t.fd(23)
            t.left(90)
            t.penup()
            t.fd(35)
            t.right(90)
        t.penup()
        t.fd(50)


def main():
    t.setup(800, 300)
    t.penup()
    t.fd(-300)
    t.pensize(5)
    t.speed(0)

    date = time.strftime('%Y年%m月%d日',time.localtime())
    drawDate(date)

    t.hideturtle()
    t.done()

if __name__ == '__main__':
    main()